﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Result : MonoBehaviour
{
        [Header("所在的区域编号")]
        public int area;
        [Header("所在区域内的ID")]
        public int id = 0;

        [Header("描述文本")]
        public TextMesh description;

        public void Close()
        {
                this.transform.gameObject.SetActive(false);
        }

        void Start()
        {
                Close();
        }

        public void SetResult(Vec3dInfo ver,int rid)
        {
                if (description != null)
                {
                        //设置描述
                        string des = "解" + (rid + 1) + ":<color=red>(" + ver.x.ToString("f2") + "," + ver.y.ToString("f2") + "," + ver.z.ToString("f2") + ")</color>  ";
                        description.text = des;
                }

                //设置自身坐标
                //this.transform.position = XYZTranslate.GetXYZ(area, ver);
                this.transform.localPosition = XYZTranslate.GetLocalXYZ(ver);
                this.transform.gameObject.SetActive(true);

        }

}
